#include <iostream>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (--t >= 0) {
        int n, prev = 0, abit, bbit;
        string b;

        cin >> n >> b;
        for (int i = 0; i < n; i++) {
            bbit = b[i] - '0';
            abit = (bbit == 0 && prev == 1) || (bbit == 1 && prev == 2) ? 0 : 1;
            cout << abit;
            prev = abit + bbit;
        }
        cout << endl;
    }
    return 0;
}